<template>
	<view class="my-steps">
		<view class="step-left">
			<view class="step-left-item step-item" v-for='(item, i) in options' :key='i'
			:class="i===options.length-1?'step-other':''">
				<view class="point" :class="i < active ?'active':''"></view>
				<view class="line" v-if='i!==options.length-1'></view>
			</view>
		</view>
		<view class="step-right">
			<view class="step-right-item step-item" v-for='(item, i) in options' :key='i' 
			:class="i===options.length-1?'step-other':''">
				<view class="tip">
					<view class="title">{{item.staffRemark}}</view>
					<view class="desc">{{item.customerRemark}}</view>
				</view>
				<button class="btn" v-if='item.btn' @click="goServeInfo(i)" type="default">{{item.btn}}</button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"my-step",
		props:{
			active:{
				type:Number,
				default:0
			},
			options:{
				type:Array,
				default:() => {
					return []
				}
			}
		},
		data() {
			return {
				
			};
		},
		methods:{
			goServeInfo(i){
				// this.$setStorageSync('orderInfo', this.orderDetail)
				// let sn = this.orderDetail.sn;
				let type = this.options[i].btnType
				this.$setStorageSync('serveInfo', this.options[i])
				uni.navigateTo({
					url:`/subpackage/index/serveInfo?type=${type}`
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
  .my-steps{
	 display: flex;
	 justify-content: flex-start;
	 width: 90%;
	 margin: 0 auto;
	 overflow: hidden;
	 padding-top: 20rpx;
	 overflow: hidden;
	 .step-item{
		height: 200rpx; 
		box-sizing: border-box;
		display: flex;
		flex-direction: column;
		justify-content: flex-start;
	 }
	 .step-item.step-other{
		 height: 100rpx; 
	 }
	 .step-left{
		 width: 50rpx;
		 height: auto;
		 overflow: hidden;
		 align-items: center;
		 .step-left-item{
			 display: flex;
			 flex-direction: column;
			 justify-content: flex-start;
			 align-items: center;
		 }
		 .point{
			 width: 16rpx;
			 height: 16rpx;
			 margin: 8rpx auto 4rpx; 
			 border-radius: 16rpx;
			 // background: #02B1AA;
			 background: #999;
			 box-shadow: 0rpx 0rpx 10rpx 2rpx #999;
		 }
		 .point.active{
			 background: #02B1AA;
			 box-shadow: 0rpx 0rpx 10rpx 2rpx #02B1AA;
		 }
		 .line{
			 height: 178rpx;
			 width: 0;
			 border-left: 1px dashed #999;
		 }
	 }
	 .step-right{
		width: calc(100% - 50rpx); 
		font-size: 28rpx;
		.step-right-item{
			display: flex;
			flex-direction: row;
			justify-content: space-between;
			align-items: flex-start;
			.tip{
				margin-left: 20rpx;
				.title{
					font-size: 30rpx;
					font-weight: 800;
					color: #2A2B2B;
					line-height: 40rpx;
				}
				.desc{
					font-size: 24rpx;
					color: #AEB3B3;
					margin-top: 10rpx;
				}
			}
			.btn{
				margin: 0;
				width: 200rpx;
				height: 60rpx;
				line-height: 60rpx;
				border-radius: 10rpx;
				background-color: #02B1AA;
				color: #fff;
				font-size: 24rpx;
			}
		}
	 }
  }
</style>